<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>



<link rel="stylesheet" type="text/css" href="<%=path %>/css/bootstrap.min.css" />   
	<link rel="stylesheet" type="text/css" href="<%=path %>/css/common.css" />   
	
<style>
<!--

-->

</style>


<!-- 模态框（Modal） -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" 
   aria-labelledby="myModalLabel" aria-hidden="true">
   <div class="modal-dialog">
      <div class="modal-content">
         <div class="modal-header">
            <h4 class="modal-title" id="myModalLabel">
               提示
            </h4>
         </div>
         <div class="modal-body">
            <span id="modalmsg"></span>
         </div>
         <div class="modal-footer">
            <button type="button" class="btn btn-default" 
               data-dismiss="modal">知道啦
            </button>
         </div>
      </div><!-- /.modal-content -->
</div><!-- /.modal -->
</div>
<button id="modalbtn" data-toggle="modal" data-target="#myModal" style="display:none;"> </button>
<!-- 模态框（Modal） -->

<!-- 警告框 -->
<div class="alert alert-danger" style="display:none;position:absolute;bottom:0px;right:10px;width:300px;z-index:10000;margin-bottom:30px;margin-right:10px;" id="warnmodal">
   <a href="#" class="close" data-dismiss="alert">
      <!-- &times; -->
   </a>
   <strong>警告！</strong><span id="warnmsg"></span>
</div>
<div class="alert alert-success" style="display:none;position:absolute;bottom:0px;right:10px;width:300px;z-index:10000;margin-bottom:30px;margin-right:10px;" id="sucmodal">
   <a href="#" class="close" data-dismiss="alert">
      <!-- &times; -->
   </a>
   <strong>提示！</strong><span id="sucmsg"></span>
</div>
<!--  警告框  --> 

    <div class="tip" style="display:none;">
    	<div class="tiptop"><span>提示信息</span><a></a></div>
        
      <div class="tipinfo">
        <span><img src="images/ticon.png" /></span> 
        <div class="tipright">
        <p>是否确认对信息的修改 ？</p>
        <cite>如果是请点击确定按钮 ，否则请点取消。</cite>
        </div>
        </div>
        
        <div class="tipbtn">
        <input name="" type="button"  class="sure" value="确定" />&nbsp;
        <input name="" type="button"  class="cancel" value="取消" />
        </div>
    
    </div>
    

<script type="text/javascript" src="<%=path %>/js/resources/bootstrap.min.js"></script>
<script type="text/javascript" src="<%=path %>/js/resources/moment.js"></script>
<script type="text/javascript" src="<%=path %>/js/resources/moment-zh-cn.js"></script>
<script>
	var path='<%=basePath%>'; 
	moment.locale('zh-cn');
	$(function() { 
		if ('${ empty curuser}' == 'true') {
			window.location.href = path + "/login.jsp";
		}
		beginAutoRefreshNowTimeLabel();
	});
	function logout() {
		$.ajax({
			type : "POST",
			url : path + "/adminUserAction_logout.action",
			dataType : "json",
			success : function(result) {
				window.location.href = path + "/login.jsp";
			}
		});
	}
	
	function findWeather() {
	    var cityUrl = 'http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js';
	    $.getScript(cityUrl, function(script, textStatus, jqXHR) {
	        var citytq = remote_ip_info.city ;// 获取城市
	        var url = "http://php.weather.sina.com.cn/iframe/index/w_cl.php?code=js&city=" + citytq + "&day=0&dfc=3";
	        $.ajax({
	            url : url,
	            dataType : "script",
	            scriptCharset : "gbk",
	            success : function(data) {
	                var _w = window.SWther.w[citytq][0];
	                var _f= _w.f1+"_0.png";
	                if(new Date().getHours() > 17){
	                     _f= _w.f2+"_1.png";                
	                }
	                var img = "<img width='16px' height='16px' src='http://i2.sinaimg.cn/dy/main/weather/weatherplugin/wthIco/20_20/" +_f
	                + "' />";
	                var tq = citytq + " " + img + " " + _w.s1 + " " + _w.t1 + "℃～" + _w.t2 + "℃  " + _w.d1 + _w.p1 + "级";
	                 
	                $('#weather').html(tq);
	            }
	        });
	    });
	}
	
	
	/**
	 * 刷新屏幕当前时间显示
	 */
	function beginAutoRefreshNowTimeLabel() {
		
		var refresh = function() {
			$('#nowTime').text(moment().format('h:mm:ss a'));
		};
		refresh();
		window.setInterval(refresh, 1000);
	};
	
	function showModal(msg){
		$("#modalmsg").text(msg);
		debugger;
		$("#modalbtn").trigger('click');
	}
	function showWarnMsg(msg){
		$("#warnmsg").text(msg);
		$("#warnmodal").show();
		setTimeout(function(){
			$("#warnmodal").hide();
		},3000);
			
	}
	function showSucMsg(msg){
		$("#sucmsg").text(msg);
		$("#sucmodal").show();
		setTimeout(function(){
			$("#sucmodal").hide();
		},3000);
	}
	$(".tiptop a").click(function(){
	  $(".tip").fadeOut(200);
	});

	 $(".sure").click(function(){
	  $(".tip").fadeOut(100);
	});

	$(".cancel").click(function(){
	  $(".tip").fadeOut(100);
	});
		  
</script>
